//
//  ReturnLastNav.swift
//  learn-ios
//
//  Created by Dong on 2022/4/6.
//

import SwiftUI

struct ReturnLastNav: View {
    // 声明dismiss
    @Environment(\.dismiss) private var dismiss
    
    var body: some View {
        VStack {
            HStack {
                
                NavigationLink {} label: {
                    Image(systemName: "chevron.left")
                        .navigationBarHidden(true)
                        // 手势轻击执行操作
                        .onTapGesture {
                            dismiss()
                        }
                }
                Spacer()
            }
            Spacer()
        }
        .padding()
    }
}

struct ReturnLastNav_Previews: PreviewProvider {
    static var previews: some View {
        NavigationView {
//            NavigationLink {
            ReturnLastNav()
//            } label: {
//                Text("子页面")
//            }
        }
    }
}
